← Back
Editing: add-forbid-limit.js
import{c as e,k as a,r as s,q as l,v as t,e as m,A as r,x as d,y as i,aa as o,a8 as u}from"./base-lib.js?v=1765440387";import{at as p,j as n,b as c}from"./utils-lib.js?v=1765440387";import{g1 as f}from"./site.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";const b={class:"p-[20px]"},g=e({__name:"add-forbid-limit",props:{compData:{default:()=>({})}},emits:["close"],setup(e,{expose:g,emit:_}){const x=c(),y=e,w=_,h=a({suffix:y.compData.suffix||"php|jsp",deny_name:y.compData.name||"",dir:y.compData.dir||""}),D=s(!1),V=s(),j=a({dir:[{required:!0,message:"请输入需要禁止访问的目录",trigger:"blur"}],deny_name:[{required:!0,message:"请输入名称",trigger:"blur"}],suffix:[{required:!0,message:"请输入后缀",trigger:"blur"}]});return g({onConfirm:async e=>{await V.value.validate();try{D.value=!0;const e=await f({website:y.compData.website,...h,act:y.compData.name?"edit":"add"});e.status?(y.compData.name&&(e.msg="修改成功"),x.success(e.msg),y.compData.refresh(),w("close")):x.msg({customClass:"bt-message-error-html",dangerouslyUseHTMLString:!0,message:e.msg,type:"error",duration:0,showClose:!0})}catch(a){p(a)}finally{D.value=!1}}}),(a,s)=>{const p=n,c=o,f=u;return l(),t("div",b,[m(f,{ref_key:"forbidSiteForm",ref:V,rules:d(j),model:d(h),disabled:d(D)},{default:r(()=>[m(c,{label:"名称",prop:"deny_name"},{default:r(()=>[m(p,{modelValue:d(h).deny_name,"onUpdate:modelValue":s[0]||(s[0]=e=>d(h).deny_name=e),disabled:e.compData.name,width:"26rem"},null,8,["modelValue","disabled"])]),_:1}),m(c,{label:"后缀",prop:"suffix"},{default:r(()=>[m(p,{modelValue:d(h).suffix,"onUpdate:modelValue":s[1]||(s[1]=e=>d(h).suffix=e),width:"26rem"},null,8,["modelValue"])]),_:1}),m(c,{label:"访问路径",prop:"dir"},{default:r(()=>[m(p,{modelValue:d(h).dir,"onUpdate:modelValue":s[2]||(s[2]=e=>d(h).dir=e),placeholder:"URL中禁止访问的,如/api等",width:"26rem"},null,8,["modelValue"])]),_:1}),s[3]||(s[3]=i("ul",{class:"ml-6 mt-8 list-disc leading-10"},[i("li",{class:"text-medium"},"后缀:禁止访问的文件后缀"),i("li",{class:"text-medium"},"访问路径:如需要禁止https://www.bt.cn/api/,则填写/api即可")],-1))]),_:1},8,["rules","model","disabled"])])}}});export{g as default};
Save File
Cancel